<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>margin合并的三种情况</title>
    <style>
        body{
            display: inline-block;
        }
        *{
            box-sizing: border-box;
            /*display: inline-block;*/
        }
        .div1,.div1-1,.c1,.c2{
            width:50px;
            height:50px;
            margin-top: 30px;
            background-color: blue;
        }
        .div1{
            margin-bottom: 50px;
        }
        .div1-1,.c2{
            margin-bottom: 100px;
        }
        .parent{
            display: inline-block;
            background-color: burlywood;
            margin-top:100px;
        }
    </style>
</head>
<body>
<!--相邻兄弟元素-->
<div class="div1"></div>
<div class="div1-1"></div>
<div></div>
<!--父级和第一个元素或者最后一个元素-->
<div class="parent">
    <div class="c1"></div>
    <div class="c2"></div>
</div>
<!--空块的合并-->
</body>
</html>